<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>PaleGem: pgInputEventManager Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PaleGem
   &#160;<span id="projectnumber">0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classpg_input_event_manager-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">pgInputEventManager Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>PaleGem's keyboard event manager.  
 <a href="classpg_input_event_manager.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="pg_input_event_manager_8h_source.html">pgInputEventManager.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for pgInputEventManager:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classpg_input_event_manager.png" usemap="#pgInputEventManager_map" alt=""/>
  <map id="pgInputEventManager_map" name="pgInputEventManager_map">
<area href="class_i_event_manager.html" title="Manages events and listeners." alt="IEventManager" shape="rect" coords="0,0,136,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a751b6861a24c5adc0bbf5a57a979a2fe"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a751b6861a24c5adc0bbf5a57a979a2fe">pgInputEventManager</a> ()</td></tr>
<tr class="separator:a751b6861a24c5adc0bbf5a57a979a2fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d1b1aaba16afa0c0c9d311f9b258c4e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a1d1b1aaba16afa0c0c9d311f9b258c4e">~pgInputEventManager</a> ()</td></tr>
<tr class="separator:a1d1b1aaba16afa0c0c9d311f9b258c4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add5f4d0acf0970c5963dcd5c7e7275b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#add5f4d0acf0970c5963dcd5c7e7275b5">ShutDown</a> ()</td></tr>
<tr class="memdesc:add5f4d0acf0970c5963dcd5c7e7275b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shuts down the event manager, frees leftover events and listeners, deallocates memory.  <a href="#add5f4d0acf0970c5963dcd5c7e7275b5">More...</a><br/></td></tr>
<tr class="separator:add5f4d0acf0970c5963dcd5c7e7275b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a451a5000cde52f87fdfd7c81fbfb9540"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a451a5000cde52f87fdfd7c81fbfb9540">Update</a> (float frameTime)</td></tr>
<tr class="memdesc:a451a5000cde52f87fdfd7c81fbfb9540"><td class="mdescLeft">&#160;</td><td class="mdescRight">Not used.  <a href="#a451a5000cde52f87fdfd7c81fbfb9540">More...</a><br/></td></tr>
<tr class="separator:a451a5000cde52f87fdfd7c81fbfb9540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fc9092074b92baba1566c3e51ddbaad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a9fc9092074b92baba1566c3e51ddbaad">RegisterListener</a> (<a class="el" href="class_i_event_listener.html">IEventListener</a> *listener, <a class="el" href="_i_event_manager_8h.html#ab13f1eb4f7990ad6a97263126b1e8565">EVENT_CLASS</a> eventClass=<a class="el" href="_i_event_manager_8h.html#ab13f1eb4f7990ad6a97263126b1e8565a230d22d3c096db888df52a0e5d5ba7ac">EC_UNKNOWN</a>, <a class="el" href="_i_event_manager_8h.html#acebeb2e728025f3444b405355a3f8e92">EVENT_NAME</a> eventName=<a class="el" href="_i_event_manager_8h.html#acebeb2e728025f3444b405355a3f8e92a0bdce79d948b8215713bcf669df0b8f1">E_UNKNOWN</a>)</td></tr>
<tr class="memdesc:a9fc9092074b92baba1566c3e51ddbaad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a listener to receive input events DEPRECHEATED.  <a href="#a9fc9092074b92baba1566c3e51ddbaad">More...</a><br/></td></tr>
<tr class="separator:a9fc9092074b92baba1566c3e51ddbaad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae404352163a7bda1b7392a95600f7eda"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#ae404352163a7bda1b7392a95600f7eda">UnregisterListener</a> (<a class="el" href="class_i_event_listener.html">IEventListener</a> *listener)</td></tr>
<tr class="memdesc:ae404352163a7bda1b7392a95600f7eda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister a listener.  <a href="#ae404352163a7bda1b7392a95600f7eda">More...</a><br/></td></tr>
<tr class="separator:ae404352163a7bda1b7392a95600f7eda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e5414722dc173201669de70df67352f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a4e5414722dc173201669de70df67352f">RegisterEvent</a> (int eventName, int eventClass, <a class="el" href="struct_i_event_data.html">IEventData</a> *pData)</td></tr>
<tr class="memdesc:a4e5414722dc173201669de70df67352f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a keyboard input event.  <a href="#a4e5414722dc173201669de70df67352f">More...</a><br/></td></tr>
<tr class="separator:a4e5414722dc173201669de70df67352f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5682ce21dfb54bd66782605241636d80"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a5682ce21dfb54bd66782605241636d80">IsKeyPressed</a> (unsigned int id)</td></tr>
<tr class="memdesc:a5682ce21dfb54bd66782605241636d80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether the specified key is pressed.  <a href="#a5682ce21dfb54bd66782605241636d80">More...</a><br/></td></tr>
<tr class="separator:a5682ce21dfb54bd66782605241636d80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeecb9a05547e503ae0881a450e36d27a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#aeecb9a05547e503ae0881a450e36d27a">MapKey</a> (BYTE virtualKey, unsigned int pgKey)</td></tr>
<tr class="memdesc:aeecb9a05547e503ae0881a450e36d27a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map a windows key to a palegem key.  <a href="#aeecb9a05547e503ae0881a450e36d27a">More...</a><br/></td></tr>
<tr class="separator:aeecb9a05547e503ae0881a450e36d27a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_i_event_manager"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_i_event_manager')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_i_event_manager.html">IEventManager</a></td></tr>
<tr class="memitem:a6f0594c36436cef0ec2f1a292e696a3c inherit pub_methods_class_i_event_manager"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_i_event_manager.html#a6f0594c36436cef0ec2f1a292e696a3c">~IEventManager</a> ()</td></tr>
<tr class="separator:a6f0594c36436cef0ec2f1a292e696a3c inherit pub_methods_class_i_event_manager"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a61acee7c96dc6043505b031e38e92737"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a61acee7c96dc6043505b031e38e92737">KeyPressed</a> (unsigned int id)</td></tr>
<tr class="memdesc:a61acee7c96dc6043505b031e38e92737"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a key's state to pressed.  <a href="#a61acee7c96dc6043505b031e38e92737">More...</a><br/></td></tr>
<tr class="separator:a61acee7c96dc6043505b031e38e92737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48dca7c25cbe1f2d739f172b189d6fcf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a48dca7c25cbe1f2d739f172b189d6fcf">KeyReleased</a> (unsigned int id)</td></tr>
<tr class="memdesc:a48dca7c25cbe1f2d739f172b189d6fcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a key's state to released.  <a href="#a48dca7c25cbe1f2d739f172b189d6fcf">More...</a><br/></td></tr>
<tr class="separator:a48dca7c25cbe1f2d739f172b189d6fcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a147e21dbfc604b1630863d119bf75db4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a147e21dbfc604b1630863d119bf75db4">DispatchEvents</a> (unsigned int pgKey, int activationMode)</td></tr>
<tr class="memdesc:a147e21dbfc604b1630863d119bf75db4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send events to listeners.  <a href="#a147e21dbfc604b1630863d119bf75db4">More...</a><br/></td></tr>
<tr class="separator:a147e21dbfc604b1630863d119bf75db4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ad6cc5b9a13daa533e33ba8fa5d89ff53"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#ad6cc5b9a13daa533e33ba8fa5d89ff53">m_nButtonStates</a></td></tr>
<tr class="memdesc:ad6cc5b9a13daa533e33ba8fa5d89ff53"><td class="mdescLeft">&#160;</td><td class="mdescRight">1 is pressed 0 means released  <a href="#ad6cc5b9a13daa533e33ba8fa5d89ff53">More...</a><br/></td></tr>
<tr class="separator:ad6cc5b9a13daa533e33ba8fa5d89ff53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e6f76dc7af85ec3022fd67b268099ea"><td class="memItemLeft" align="right" valign="top">std::map&lt; BYTE, unsigned int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a9e6f76dc7af85ec3022fd67b268099ea">m_keyMaps</a></td></tr>
<tr class="memdesc:a9e6f76dc7af85ec3022fd67b268099ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects virtual keys to internal keynumbers.  <a href="#a9e6f76dc7af85ec3022fd67b268099ea">More...</a><br/></td></tr>
<tr class="separator:a9e6f76dc7af85ec3022fd67b268099ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4790e2b9a70dee590435f60923e6db2c"><td class="memItemLeft" align="right" valign="top">std::list&lt; <a class="el" href="class_i_event_listener.html">IEventListener</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpg_input_event_manager.html#a4790e2b9a70dee590435f60923e6db2c">m_listeners</a></td></tr>
<tr class="memdesc:a4790e2b9a70dee590435f60923e6db2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">List of objects that listen for input events.  <a href="#a4790e2b9a70dee590435f60923e6db2c">More...</a><br/></td></tr>
<tr class="separator:a4790e2b9a70dee590435f60923e6db2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>PaleGem's keyboard event manager. </p>
<p>Processed keyboard inputs.</p>
<h2>Inititalizing</h2>
<p>First you have to map a windows key to a palegem key. This is done by calling <a class="el" href="classpg_input_event_manager.html#aeecb9a05547e503ae0881a450e36d27a" title="Map a windows key to a palegem key.">MapKey()</a>. The virtual key is a windows key (See also EWindowsVirtualKeys) while pgKey is one of the 32 palegem keys. Note that you can map multiple windows keys to the same palegem key but not vice versa. After mapping the desired keys you will have to take care of sending the WM_KEYDOWN and WM_KEYUP events from your window procedure to the input event manager, by calling <a class="el" href="classpg_input_event_manager.html#a4e5414722dc173201669de70df67352f" title="Register a keyboard input event.">RegisterEvent()</a> on both messages. Use wParam for the event name, eKPEC_press or eKPEC_release for the eventclass during the respective message, and NULL for event data (note that event data is not processed at all, meaning you <em>can</em> send some sort of data to the event manager but it will simply ignore it and do nothing with it, including not sending it to listeners). A good idea is to create your own enum mapping for the palegem keys, e.g.</p>
<p>enum MyGameKeyMaps { forward = PG_KEY1, backward = PG_KEY3, };</p>
<p>This way you will not have to memorize which PG_KEY triggers which action in your game.</p>
<h2>Getting input from the keyboard</h2>
<p>After yo have mapped some keys you can check for them with <a class="el" href="classpg_input_event_manager.html#a5682ce21dfb54bd66782605241636d80" title="Check whether the specified key is pressed.">IsKeyPressed()</a>. This method take a PG_KEY argument and checks it against the internal button state with a bitwise AND. Note that this will return true as soon and as long as a button is pressed, which makes it unsuitable for text input. NOTE: Using <a class="el" href="classpg_input_event_manager.html#a9fc9092074b92baba1566c3e51ddbaad" title="Register a listener to receive input events DEPRECHEATED.">RegisterListener()</a> is currently deprecheated because events are sent right when they appear, meaning you can only check for one key per frame. For example: Using <a class="el" href="classpg_input_event_manager.html#a9fc9092074b92baba1566c3e51ddbaad" title="Register a listener to receive input events DEPRECHEATED.">RegisterListener()</a> you cannot check if PG_KEY1 and PG_KEY2 are pressed simultaniously, as you receive either PG_KEY1 <em>or</em> PG_KEY2 but not both. To achieve such a behaviour, use <a class="el" href="classpg_input_event_manager.html#a5682ce21dfb54bd66782605241636d80" title="Check whether the specified key is pressed.">IsKeyPressed()</a>. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a751b6861a24c5adc0bbf5a57a979a2fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pgInputEventManager::pgInputEventManager </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a1d1b1aaba16afa0c0c9d311f9b258c4e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pgInputEventManager::~pgInputEventManager </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a147e21dbfc604b1630863d119bf75db4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::DispatchEvents </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pgKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>activationMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Send events to listeners. </p>

</div>
</div>
<a class="anchor" id="a5682ce21dfb54bd66782605241636d80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool pgInputEventManager::IsKeyPressed </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check whether the specified key is pressed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>See EKeyPressKeyEventName. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if key is pressed. </dd></dl>

</div>
</div>
<a class="anchor" id="a61acee7c96dc6043505b031e38e92737"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::KeyPressed </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets a key's state to pressed. </p>

</div>
</div>
<a class="anchor" id="a48dca7c25cbe1f2d739f172b189d6fcf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::KeyReleased </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets a key's state to released. </p>

</div>
</div>
<a class="anchor" id="aeecb9a05547e503ae0881a450e36d27a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::MapKey </td>
          <td>(</td>
          <td class="paramtype">BYTE&#160;</td>
          <td class="paramname"><em>virtualKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pgKey</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Map a windows key to a palegem key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">virtualKey</td><td>Windows key code of the key to be mapped. </td></tr>
    <tr><td class="paramname">pgKey</td><td>The PG_KEY the specified windows key shall be mapped to. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4e5414722dc173201669de70df67352f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::RegisterEvent </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>eventName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>eventClass</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_i_event_data.html">IEventData</a> *&#160;</td>
          <td class="paramname"><em>pData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Register a keyboard input event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">eventName</td><td>Usually the wParam of the window procedure, but more precisely the windows virtual key number </td></tr>
    <tr><td class="paramname">eventClass</td><td>Pressed or released? See EKeyPressEventClass. </td></tr>
    <tr><td class="paramname">pData</td><td>Not used. Use NULL. </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="class_i_event_manager.html#a392a23f11ab77aa893cbef5bd4cd6fa8">IEventManager</a>.</p>

</div>
</div>
<a class="anchor" id="a9fc9092074b92baba1566c3e51ddbaad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::RegisterListener </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_i_event_listener.html">IEventListener</a> *&#160;</td>
          <td class="paramname"><em>listener</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_i_event_manager_8h.html#ab13f1eb4f7990ad6a97263126b1e8565">EVENT_CLASS</a>&#160;</td>
          <td class="paramname"><em>eventClass</em> = <code><a class="el" href="_i_event_manager_8h.html#ab13f1eb4f7990ad6a97263126b1e8565a230d22d3c096db888df52a0e5d5ba7ac">EC_UNKNOWN</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_i_event_manager_8h.html#acebeb2e728025f3444b405355a3f8e92">EVENT_NAME</a>&#160;</td>
          <td class="paramname"><em>eventName</em> = <code><a class="el" href="_i_event_manager_8h.html#acebeb2e728025f3444b405355a3f8e92a0bdce79d948b8215713bcf669df0b8f1">E_UNKNOWN</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Register a listener to receive input events DEPRECHEATED. </p>

<p>Implements <a class="el" href="class_i_event_manager.html#a4bc99cb0ef622ba2ec2ab0e1f2ca16c9">IEventManager</a>.</p>

</div>
</div>
<a class="anchor" id="add5f4d0acf0970c5963dcd5c7e7275b5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::ShutDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Shuts down the event manager, frees leftover events and listeners, deallocates memory. </p>

<p>Implements <a class="el" href="class_i_event_manager.html#aa5e47321003d80135281a90034c7064e">IEventManager</a>.</p>

</div>
</div>
<a class="anchor" id="ae404352163a7bda1b7392a95600f7eda"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::UnregisterListener </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_i_event_listener.html">IEventListener</a> *&#160;</td>
          <td class="paramname"><em>listener</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Unregister a listener. </p>

<p>Implements <a class="el" href="class_i_event_manager.html#a5e6327650d496ce27637550bc46d808b">IEventManager</a>.</p>

</div>
</div>
<a class="anchor" id="a451a5000cde52f87fdfd7c81fbfb9540"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pgInputEventManager::Update </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>frameTime</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Not used. </p>

<p>Implements <a class="el" href="class_i_event_manager.html#a71e4cf7f0b61929a3f878e0d09778d9b">IEventManager</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a9e6f76dc7af85ec3022fd67b268099ea"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt;BYTE, unsigned int&gt; pgInputEventManager::m_keyMaps</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Connects virtual keys to internal keynumbers. </p>

</div>
</div>
<a class="anchor" id="a4790e2b9a70dee590435f60923e6db2c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::list&lt;<a class="el" href="class_i_event_listener.html">IEventListener</a>*&gt; pgInputEventManager::m_listeners</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>List of objects that listen for input events. </p>

</div>
</div>
<a class="anchor" id="ad6cc5b9a13daa533e33ba8fa5d89ff53"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int pgInputEventManager::m_nButtonStates</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>1 is pressed 0 means released </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Inc/<a class="el" href="pg_input_event_manager_8h_source.html">pgInputEventManager.h</a></li>
<li>Source/<a class="el" href="pg_input_event_manager_8cpp.html">pgInputEventManager.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 1 2013 11:55:07 for PaleGem by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
